<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>元素增删改</title>
</head>
<body>
<select id="s">
    <option>---请选择---</option>
    <option>北京</option>
    <option>上海</option>
    <option>广州</option>
</select>
</body>
<script>
    //创建
    let option1 = document.createElement("option");
    option1.innerText="哈尔滨";

    //添加
    let select = document.getElementById("s");
    select.appendChild(option1);

    //删除
    //select.removeChild(option1);

    //替换
    let option2 = document.createElement("option");
    option2.innerText="秦皇岛";

    select.replaceChild(option2,option1);
</script>
</html>